

def hanoi(n, A, B, C):
    if n == 1:
        print(A, '----->', C)
    else:
        # print(A, "----->", B)
        hanoi(n-1, A, C, B)
        hanoi(1, A, B, C)
        hanoi(n-1, B, A, C)
        # print(B, "----->", C)


hanoi(4, 'A', 'B', 'C')


